<?php

namespace App\Decorator;

class Template {

    protected $_controller;

    function beforeRequest($controller)
    {
        $this->_controller = $controller;
    }

    function afterRequest($return_value)
    {
        if ($_GET['app'] == 'html')
        {
            foreach ($return_value as $k => $v)
            {
                $this->_controller->assign($k, $v);
            }
            $this->controller->display();
        }
    }

}
